<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
	<head>
		<meta charset="utf-8">
		<title>发布博客</title>
		<link rel="stylesheet" type="text/css" th:href="@{../../lib/layui/css/layui.css}" />
		<link rel="stylesheet" th:href="@{../../css/admin/public.css}" media="all">
		<link rel="stylesheet" th:href="@{../../lib/font-awesome-4.7.0/css/font-awesome.min.css}" media="all">
		<script th:src="@{../../lib/jquery-3.4.1/jquery-3.4.1.min.js}" type="text/javascript" charset="utf-8"></script>
		<script src="https://cdn.staticfile.org/jquery-cookie/1.4.1/jquery.cookie.min.js"></script>
		<script th:src="@{../../lib/layui/layui.js}" type="text/javascript" charset="utf-8"></script>
		<link rel="stylesheet" type="text/css" th:href="@{../../css/admin/blog-editor.css}" />
		<link rel="stylesheet" type="text/css" th:href="@{../../lib/editormd/css/editormd.css}" />
		<script th:src="@{../../lib/editormd/editormd.js}" type="text/javascript" charset="utf-8"></script>
		<style type="text/css">
			#md-editor ol>li{
				list-style: decimal;
			}
			#md-editor ul>li{
				list-style: disc;
			}
		</style>
	</head>
	<body>
		<div class="layuimini-container">
			<div class="layuimini-main">
				<div class="layui-row">
					<div class="title-input-item">
						<label class="layui-form-label" for="title">标题</label>
						<div class="layui-input-block">
							<input type="text" id="title" name="title" required lay-verify="required"
								   placeholder="请输入标题" autocomplete="off"
								   class="layui-input">
						</div>
					</div>
					<button type="button" id="btn-send" class="layui-btn"><i class="fa fa-send"></i>&nbsp;发布</button>
					<button type="button" id="btn-clear" class="layui-btn"><i class="fa fa-trash-o"></i>&nbsp;清空
					</button>
				</div>
				<div id="md-editor" class="md-editor">
					<textarea style="display:none;" class="form-control" id="content-editormd-markdown-doc" name="content-editormd-markdown-doc"></textarea>
				</div>
			</div>
		</div>
		<script th:src="@{../../js/admin/blog-editor.js}" type="text/javascript" charset="utf-8"></script>
		<script>
			/* 初始化Editormd编辑器 */
			var mdEditor;
			$(function() {
				mdEditor = editormd("md-editor", {
					width: "100%",
					height: 640,
					syncScrolling: "single",
					path: "../../lib/editormd/lib/",
					saveHTMLToTextarea: true,
					// theme: "dark",
					// previewTheme: "dark",
					// editorTheme: "pastel-on-dark",
					//图片上传开启
					imageUpload: true,
					imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
					imageUploadURL: "/upload"
				});
			});
		</script>
		<script type="text/html" id="blogPublishPopup">
			<div class="blog-publish layui-form">
				<div class="layui-form-item">
					<label class="layui-form-label">分类</label>
					<div class="layui-input-block">
						<select id="category" lay-verify="required" lay-search>
							<option value="">请选择一个分类</option>
						</select>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">标签</label>
						<div class="layui-input-inline" style="width: 120px;">
							<select id="tag1" lay-verify="" lay-search>
								<option value="">第一个标签</option>
							</select>
						</div>
						<div class="layui-form-mid">-</div>
						<div class="layui-input-inline" style="width: 120px;">
							<select id="tag2" lay-verify="" lay-search>
								<option value="">第二个标签</option>
							</select>
						</div>
						<div class="layui-form-mid">-</div>
						<div class="layui-input-inline" style="width: 120px;">
							<select id="tag3" lay-verify="" lay-search>
								<option value="">第三个标签</option>
							</select>
						</div>
					</div>
				</div>
				<div class="layui-form-item">
					<div class="layui-inline">
						<label class="layui-form-label">博客类型</label>
						<div class="layui-input-inline" style="width: 200px;">
							<select id="isOriginal" lay-search lay-filter="blogType">
								<option value="1">原创</option>
								<option value="0">转载</option>
							</select>
						</div>
						<div class="layui-input-inline" style="width: 200px;">
							<input type="text" id="reprintUrl" name="reprintUrl" placeholder="请输入原文链接" autocomplete="off" class="layui-input" style="display: none;"/>
						</div>
					</div>
				</div>
				<div class="layui-form-item checkbox-inline">
					<div class="layui-inline">
						<label class="layui-form-label">发布类型</label>
						<div class="layui-input-inline">
							<input type="checkbox" id="isPublic" name="isPublic" lay-filter="isPublic" lay-skin="switch" checked="checked" lay-text="公开|私有">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">开启置顶</label>
						<div class="layui-input-inline">
							<input type="checkbox" id="isTop" name="isTop" lay-skin="switch" lay-text="置顶|关闭">
						</div>
					</div>
					<div class="layui-inline">
						<label class="layui-form-label">开启推荐</label>
						<div class="layui-input-inline">
							<input type="checkbox" id="isRecommend" name="isRecommend" lay-skin="switch" lay-text="推荐|关闭">
						</div>
					</div>
				</div>
			</div>
		</script>
	</body>
</html>
